Conventionally, sampling data is well used for the analysis of program behavior and for a performance tuning. For instance, a conventional apparatus for measuring an electric power consumed by running programs on the CPU first samples information (such as an executing instruction address or a Process ID) associated with identified execution programs or functions. Next it analyzes the data and profiles the executed programs. So we can grasp a behavior of programs or figure out improvement points of its performance.
As a system for sampling the above mentioned information, a time based sampling system is used well. Its reason is that a time based performance or a processing performance has been highly called for system requirements in computer design, programming, and construction or management of the system until now.
However, the power consumption becomes the first requirement for those systems now. Therefore, a power consumption based sampling is needed for running programs or executing instructions.
On the other hand, as a conventional program behavior analysis method in the viewpoint of the power consumption, there is a technique for utilizing a performance counter with which the processor is equipped.
It is the technique of counting a frequency of occurrence of some events related to the power consumption by a performance counter, and estimating the power consumption by using the electric power equivalent or formula corresponding to each event at analyzing (for example, refer to non-patent literature 1; F. Bellosa, “The Benefits of Event-Driven Energy Accounting in Power-Sensitive Systems,” Proc. SIGOPS European Workshop, ACM Press, 2000, pp. 37-42).
However, the above mentioned technique has the following problems. First, it cannot make a power consumption profile (items analysis of power consumption according to a running program on the CPU). That is, there is the problem that the power consumption of the whole system within a measurement period is only known, but the rate of the power consumption for every running program as the items is not known.
On the other hand, in the non-patent literature 1, by using an improved kernel, a counter value is saved for every running program and the profile based on the power consumption of a program is made possible. But, in a general kernel, the profile analysis cannot be realized.
Moreover, it has a problem in the point of accuracy. First of all, the technique gives only an estimated value, but its value is not indicating power consumption correctly. Furthermore, since number of the performance counter is limited, there is also a problem that events required for electric power calculation are simultaneously un-extractable depending on a processor.
In that case, since the event is gathered dividing into several-time and it will do a synthetic calculation when analyzing it, the possibility of not reflecting correct power consumption rises more and more, and uneasiness remains there in the point of reliability or accuracy.
As for the above mentioned problem, in the time base sampling, power consumption was also recorded with an instruction address information etc. for every sampling, and the profile of power consumption of the real measurement base which is not an estimate is realized with the patent document 1 (Japanese Patent Laid-Open Publication No. 2005-25754).
However, in the patent documents 1, it is difficult to find the program of large power consumption correctly.
For example, FIG. 13 shows the sampling result of power consumption by time base when “the program A” or “the program B” was executed in the CPU core (the graph shows “time” for a horizontal axis and “power consumption” for a vertical axis).
Power consumption by the program A is small, but execution time by the program A occupies a greater portion. On the other hand, power consumption by the program B is large, but execution time by the program B occupies a less portion.
In such case, although essentially the program B should be found out, the sampling means cannot find out it since timing of extraction at the program B shifts from each sampling time.
Thus, the time base sampling is the technique which information required for analysis is extracted at every constant period (for example, every ms) and the items of the running program are analyzed based on the number of sampling from the extraction data (profile). Analysis which is statistically meaningful can be performed in relation only with time.
Thus, such a mismatch between power consumption measurement and its profile arises from sampling the profile of the power consumption with the time base. That is, in order to profile power consumption, the data sampling is requested to be done with the power consumption base.